fix: repair cross-package bugs so tests and tsc pass - #85
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import renamed hook useDebounce (was useThrottle) from @e2e/utils - Button: pass aria-label through so icon-only buttons expose an accessible name - DataTable: use functional updater in sort toggle to fix stale-closure bug - date.ts: use en-AU day-first numeric-day format (1/03/2024 not 01/03/2024) - bunfig.toml: run UI tests under happy-dom so `document` is defined - tsconfig.json: add bun-types so tsc resolves the bun:test module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all failing tests and type errors across the monorepo.
bun test(13 pass, 0 fail) andtsc --noEmit(clean) both green.Changes
apps/web/src/lib/api.ts—packages/utilsrenamed its hookuseThrottle→useDebounce, butapi.tsstill imported the old name (and re-exported it asuseSearchDebounce). Updated the import and re-export to the new name.packages/ui/src/components/Button/Button.tsx— the component destructured anaria-labelprop but never rendered it. Now passes it through; icon-only buttons always emit the attribute so they expose an accessible name (WCAG 4.1.2).packages/ui/src/components/DataTable/DataTable.tsx— the sort-direction toggle read the stale closed-oversortDir. Switched to the functional-updater form (setSortDir(prev => ...)) to fix the stale-closure bug caught by the controlled re-render test.packages/utils/src/format/date.ts— used a format that zero-padded the day. Switched toIntl.DateTimeFormat("en-AU", { day: "numeric", month: "2-digit", year: "numeric" })so day-first output has no leading zero on the day (e.g.1/03/2024) while keeping a 4-digit year.bunfig.toml/packages/ui/bunfig.toml— configured the UI test suite to run underhappy-domsodocumentis defined for@testing-library/react.tsconfig.json— addedbun-typestocompilerOptions.typessotscresolves thebun:testvirtual module.Constraints honoured
Verification
bun test→ 13 pass, 0 failtsc --noEmit→ clean